package ar.edu.unq.persistencia.commands;

import java.util.ArrayList;
import java.util.List;

/**
 * TODO: description
 * 
 * @param <T>
 */
public class DeleteCommand<T> extends Command<T> {

    private List<T> entitiesToDelete = new ArrayList<T>();

    public DeleteCommand(final Class clazz) {
        super(clazz);
    }

    public void run() {
        for (T entity : this.getEntitiesToDelete()) {
            this.getSession().delete(entity);
        }
    }

    public List<T> getEntitiesToDelete() {
        return this.entitiesToDelete;
    }

    public void setEntitiesToDelete(final List<T> entiesToDelete) {
        this.entitiesToDelete = entiesToDelete;
    }

}
